﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Rapid
{
    class Setup
    {
        public static void FirstRun()
        {
            // check directory  @"C:\ProgramData\db\Rapid"
            if (!Directory.Exists(DataConfig.pathdb))
                Directory.CreateDirectory(DataConfig.pathdb);

            // attach database file to @"C:\ProgramData\db\Rapid"
            if (!File.Exists(DataConfig.pathdb + "/" + DataConfig.attachdb))
            {
                File.Copy(System.AppDomain.CurrentDomain.BaseDirectory + DataConfig.attachdb, DataConfig.pathdb + "/" + DataConfig.attachdb);
                File.Copy(System.AppDomain.CurrentDomain.BaseDirectory + DataConfig.attachdb_log, DataConfig.pathdb + "/" + DataConfig.attachdb_log);
            }
        }
    }
}
